package com.jf.exam.service;


import com.jf.exam.pojo.vo.BeginExamVO;
import com.jf.exam.pojo.vo.ClassVO;
import com.jf.exam.pojo.vo.ExamAnswerVO;
import com.jf.exam.pojo.vo.ExamVO;
import com.jf.exam.utils.PageBean;
import com.jf.exam.utils.Result;

import java.lang.reflect.InvocationTargetException;

/**
 * <br/>
 * Created by weidong on 2018/07/23
 */
public interface ExamService {

    Result addExam(ExamVO examVO) throws Exception;

    Result updateExam(ExamVO examVO) throws Exception;

    Result findDetailExam(ExamVO examVO) throws Exception;

    PageBean<ExamVO> listExam(ExamVO examVO) throws Exception;

    Result listExamPage(ExamVO examVO) throws Exception;

    Result countExam(ExamVO examVO) throws Exception;

    Result deleteExam(ExamVO examVO) throws Exception;

    /**
     * 更新试卷的分数
     *
     * @param examId  试卷id
     * @param qScore  题目的分数
     * @param fkQtype 题目的类型
     */
    Integer updateExamScore(Integer examId, int qScore, Integer fkQtype);

    //根据学生的班级id查询学生的试卷列表，并排除初始化状态的试卷
    PageBean<ExamVO> listExamByClassId(ClassVO classVO) throws InvocationTargetException, IllegalAccessException;

    boolean hasJoined(Integer eid, String id);

    BeginExamVO joined(Integer eid);

    Result marking(ExamAnswerVO examAnswerVO, String sid);
}